<!-- character_search.html -->
{% extends 'homepage.html' %}

{% block content %}


<h2> Further refine search </h2>

<style>
.modulus {
    font-family: serif;
    vertical-align: top;
    padding-top: 1em;
    border-right: 2px solid #8a8;
}
.modulus a { display: inline; font-family: serif; }
.modulus font { display: inline; font-family: serif }
.chi {
    padding: 30px 30px;
    font-family: serif;
    width: 7em;
    display: inline;
    white-space:nowrap;}
.chi a { display: inline; font-family: serif;}
.primitive {
  color:green;
}
.nonprimitive {
    color:blue;
}
.heading {
    padding: 30px 30px
}
</style>


<form>
<table>

<tr>
    <td align=center> {{ KNOWL('character.dirichlet.modulus', title="Modulus") }}  <input type = 'text' name = 'modulus' size=10 value={{modulus}}></td>
    <td align=center> {{ KNOWL('character.dirichlet.conductor', title="Conductor") }} <input type='text' name='conductor' size=10 value={{conductor}}></td>
    <td align=center> {{ KNOWL('character.dirichlet.order', title="Order") }} <input type='text' name='order'size=10 value={{order}}></td>
<!--<td align=center>Parity <input type='text' name='parity' size=10 value={{parity}}>-->
</tr>
</table>
<p></p>
<td>
    <button type='submit' value='refine'>Refine</button>
</td>
</form>

<h2> Results </h2>

<table class="ntdata" style="table-layout:fixed">
    <thead class="heading" align="center">
    <tr>
        <th> {{ KNOWL('character.dirichlet', title="Character") }}</th>
        <th> {{ KNOWL('character.dirichlet.modulus', title="Modulus") }}</th>
        <th> {{ KNOWL('character.dirichlet.conductor', title="Conductor") }}</th>
        <th> {{ KNOWL('character.dirichlet.order', title="Order") }}</th>
        <th> {{ KNOWL('character.dirichlet.parity') }}</th>
    </tr>
    </thead>
    <tbody>
        {% set row_class = cycler('odd', 'even') %}
        {% for j in range(0,len): %}
        <tr class="{{ row_class.next() }}">
             <td class="modulus" align="center">
                <a href="/Character/Dirichlet/{{characters[j].modulus()}}/{{number[j]}}">{% if characters[j].is_primitive() %}<font color="green">{% else %}<font color="blue">{% endif %}&chi;<sub>{{j}}</sub></font></a>
            </td>
            <div class="chi">
            <td align=center>
                <a href="/Character/Dirichlet/?modulus={{characters[j].modulus()}}&conductor={{conductor}}&order={{order}}&parity={{parity}}">{{characters[j].modulus()}}</a>
            </td>
            <td align=center>
                <a href="/Character/Dirichlet/?modulus={{modulus}}&conductor={{characters[j].conductor()}}&order={{order}}&parity={{parity}}">{{characters[j].conductor()}}</a>
            </td>
            <td align=center>
            <a href="/Character/Dirichlet/?modulus={{modulus}}&conductor={{conductor}}&order={{characters[j].order()}}&parity={{parity}}">{{characters[j].multiplicative_order()}}</a>
            </td>
            <td  align=center>{% if characters[j].is_even() %}Even{% else %}Odd{% endif %}
            </td>
        </div>
        </tr>
    {% endfor %}
    </tbody>
</table>

{% endblock %}
